@extends('layouts.base')

@section('title', '每日最新美剧新闻趣闻图片视频短片')

@section('keyWords','每日最新 趣闻段子 美剧资讯 电影预告片 影视吐槽 视频短片 搞笑gif 内涵段子 热门剧集')
@section('description',$title)

@section('styles')
    <style>
        .subInfo {
            font-size: 13px !important;
            color: grey;
        }

        .verticalCenterHelper {
            display: inline-block;
            height: 100%;
            vertical-align: middle;
        }

        .verticalCenterImage {
            vertical-align: middle;
        }

        .smallFont {
            font-size: 13px !important;
        }

        ul.pagination {
            height: 32px !important;
            margin: 4px !important;
        }
    </style>
@endsection

@section('content')
    @include('partials.todayShowTopCarousel')

    @if(isset($tag))
        @include('tag.breadCrumb')
    @endif
    @foreach($articles as $article)
        <div class="well">
            <div class="row">
                <div class="col-md-9">
                    <h2 class="text-center lead">
                        <a href="{{route('article.show',$article)}}">
                            @if(strlen($article->html_code)>1)
                                <span class="glyphicon glyphicon-facetime-video"></span>&nbsp;
                            @endif
                            {{$article->title}}
                        </a>
                    </h2>
                    <ul class="list-inline subInfo">
                        <li>发布时间:{{$article->updated_at->diffForHumans()}}</li>
                        <li>浏览次数:{{empty($article->vote) ? 0 : $article->vote->visit}}次</li>
                        <li>用户评分:{{empty($article->vote) ? 0 : $article->vote->score}}分</li>
                    </ul>
                    <p>{{$article->excerpt}} </p>
                    <ul class="list-inline subinfo">
                        <li><strong>标签类别:</strong></li>
                        @foreach($article->tags as $tag)
                            <li>
                                <a href="{{route('tag.show',$tag)}}" class="smallFont">
                                    <span class="glyphicon glyphicon-fire"></span>{{$tag->name}}
                                </a>
                            </li>
                        @endforeach
                    </ul>

                </div>
                <div class="col-md-3 hidden-sm hidden-xs">
                    <a href="{{route('article.show',$article)}}">

                        <span class="verticalCenterHelper"></span>
                        <img data-original="{{$article->coverage_url}}?imageView2/1/w/150/h/150" alt="{{$article->title}}" class="img-circle verticalCenterImage lazy">
                    </a>
                </div>
            </div>
            @if($article->movies->count()>0)
                <ul class="list-inline ">
                    <li><strong>相关电影:</strong></li>
                    @foreach($article->movies as $movie)
                        <li>
                            <a href="{{route('movie.show',$movie)}}" role="button" data-toggle="tooltip"
                               data-placement="top" title="{{$movie->name_en}}"> <span
                                        class="glyphicon glyphicon-piggy-bank" aria-hidden="true"></span>
                                {{$movie->name_zh}}</a>
                        </li>
                    @endforeach
                </ul>
            @endif
            @if($article->shows->count()>0)
                <ul class="list-inline subinfo">
                    <li><strong>相关剧集:</strong></li>
                    @foreach($article->shows as $show)
                        <li>
                            <a href="{{route('show.show',$show)}}" role="button" data-toggle="tooltip"
                               data-placement="top" title="{{$show->name_en}}"> <span class="glyphicon glyphicon-grain"
                                                                                      aria-hidden="true"></span>
                                {{$show->name_zh}}</a>
                        </li>
                    @endforeach
                </ul>
            @endif
        </div>
    @endforeach
    <div class="well text-center">
        {!! $articles->links() !!}
    </div>

@endsection


@section('scripts')
    <script>
        $("img.lazy").lazyload();

        $('#slider').slick({
            dots: false,
            lazyLoad: 'ondemand',
            centerMode: true,
            autoplay: true,
            autoplaySpeed: 1000,
            slidesToShow: 3,
            slidesToScroll: 3,
            cssEase: 'linear',

            responsive: [
                {
                    breakpoint: 1024,
                    settings: {
                        slidesToShow: 3,
                        slidesToScroll: 3,
                        infinite: true,
                        dots: false
                    }
                },
                {
                    breakpoint: 600,
                    settings: {
                        slidesToShow: 2,
                        slidesToScroll: 2
                    }
                },
                {
                    breakpoint: 480,
                    settings: {
                        slidesToShow: 1,
                        slidesToScroll: 1
                    }
                }
            ]
        });
    </script>
@endsection
